package com.xfcy.blog.controller.system;



import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xfcy.blog.annotation.OperationLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.service.ExceptionLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (ExceptionLog)表控制层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:05
 */
@RestController
@RequestMapping("system/exceptionLog")
@Api(tags = "异常管理")
public class ExceptionLogController {

    @Resource
    private ExceptionLogService exceptionLogService;

    @GetMapping("/list")
    @SaCheckLogin
    @ApiOperation(value = "异常列表",httpMethod = "GET" ,response = R.class, notes = "异常列表")
    public R list(Integer pageNo, Integer pageSize) {
        return exceptionLogService.listException(pageNo, pageSize);
    }

    @OperationLogger(value = "删除异常日志")
    @DeleteMapping("/delete")
    @SaCheckPermission("/system/exceptionLog/delete")
    @ApiOperation(value = "删除异常日志", httpMethod = "DELETE", response = R.class, notes = "删除异常日志")
    public R deleteBatch(@RequestBody List<Long> ids) {
        return exceptionLogService.deleteBatch(ids);
    }

}

